Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Create plugin for Environment Tab in LC #2120

Merged
merged 15 commits into from
May 25, 2021

Conversation

olkornii
Copy link
Contributor

Pull Request Checklist

Code

  • Are method-/class-/variable-names meaningful?
  • Are methods concise, not too long?
  • Are catch blocks catching precise Exceptions only (no catch all)?
  • Is copyright with correct year in new files?
  • Is there a JavaDoc in every class with description of a class and an author(and issue if suitable)?
  • Is there a link to github project issue? (if needed)

Testing

  • Does it work?
  • Are the tests green on Jenkins? Is there a link to Jenkins build?

@eclipse-reddeer-bot
Copy link

Can one of the admins verify this patch?

@olkornii
Copy link
Contributor Author

olkornii commented May 17, 2021

close #2119

@odockal
Copy link
Collaborator

odockal commented May 17, 2021

testPR

Signed-off-by: Oleksii Korniienko <[email protected]>
Copy link
Contributor

@jkopriva jkopriva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also check all buttons, if they are opening new shell/dialog and check, if this dialog is opened

*
* @param Name variable name
*/
public void select(String Name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use better name: like selectVariable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Oleksii Korniienko <[email protected]>
@olkornii olkornii requested a review from jkopriva May 17, 2021 10:52
/**
* Add new environment variable
*
* @param Name variable name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also update the javadoc after changing variable names

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*
* @param id variable index
*/
public void select(int id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also add methods for selecting variables in EnvironmentTab? you have method getAllVariables, but how do I select one variable by name in this tab? Can you please also change name of current methods select(...) to selectEnvironmentVariable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

olkornii added 4 commits May 17, 2021 15:08
variables, added check for overwrite variable

Signed-off-by: Oleksii Korniienko <[email protected]>
Signed-off-by: Oleksii Korniienko <[email protected]>
Signed-off-by: Oleksii Korniienko <[email protected]>
edit, remove and copy

Signed-off-by: Oleksii Korniienko <[email protected]>
new OkButton().click();
try {
new WaitUntil(new ShellIsAvailable(OVERWRITE_SHELL_TITLE), TimePeriod.SHORT);
new YesButton().click();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwriting value should be disabled by default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that overwriting the value should be default choice but the option not to override is also implemented in api. I can imagine that user would like to add the intended value no matter there already exists one as he should know what he wants. Instead of not passing it be default which would require a debugging session to find out why the env is not set, imho.

* @param variableName variable name
* @param newValue new variable value
*/
public void edit(String variableName, String newValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can call edit(String variableName,String variableName,String newValue) or you can put null instead of second parameter and change edit(String variableName, String newName, String newValue) accordingly(if newName is null, do not change Name text)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

olkornii added 2 commits May 24, 2021 11:56
Signed-off-by: Oleksii Korniienko <[email protected]>
olkornii added 3 commits May 24, 2021 14:06
Signed-off-by: Oleksii Korniienko <[email protected]>
Signed-off-by: Oleksii Korniienko <[email protected]>
Signed-off-by: Oleksii Korniienko <[email protected]>
* @param name variable name
* @param value variable value
*/
public void add(String name, String nalue) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can instead of basically rewriting the method that follows with boolean params, simply call the later implementation with default boolean value. And I would go with default overwrite = true instead of false...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* @param variableName variable name for select
*/
public void selectEnvironmentVariable(String variableName) {
new PushButton("Select...").click();
Copy link
Collaborator

@odockal odockal May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have this similarities in implementation write only once. Like maybe using functional interface to pass specific code into repeated passages? Ie:

	public void versionOne(String param) {
		versionImpl(() -> {
			System.out.println("I am String!");
		});
	}
	
	public void versionTwo(int param) {
		versionImpl(() -> {
			System.out.println("I am int!");
		});
	}
	
	private void versionImpl(Runnable mySpecificImpl) {
		System.out.println("Actions before my functional interface call");
		mySpecificImpl.run();
		System.out.println("Actions after my functional interface call");
	}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@olkornii olkornii requested a review from jkopriva May 25, 2021 12:07
@odockal odockal removed the request for review from jkopriva May 25, 2021 12:25
@odockal odockal requested a review from jkopriva May 25, 2021 12:25
@odockal
Copy link
Collaborator

odockal commented May 25, 2021

@jkopriva thanks for review, I would like to have this merged in M3 milestone, if there will be something you do not like, we would have it addressed after that.

@odockal odockal merged commit f0b2b69 into eclipse-archived:master May 25, 2021
olkornii added a commit to olkornii/jbosstools-quarkus that referenced this pull request May 31, 2021
olkornii added a commit to olkornii/jbosstools-quarkus that referenced this pull request Jun 7, 2021
olkornii added a commit to olkornii/jbosstools-quarkus that referenced this pull request Jun 21, 2021
jkopriva pushed a commit to jbosstools/jbosstools-quarkus that referenced this pull request Jun 22, 2021
…#145)

* JBIDE-27821: Created test for Environment variables in Quarkus Launch
Configuration

Signed-off-by: Oleksii Korniienko <[email protected]>

* JBIDE-27821: fixed Copyright year

Signed-off-by: Oleksii Korniienko <[email protected]>

* JBIDE-27821: reworked "addEnvironment" due to
eclipse-archived/reddeer#2120

Signed-off-by: Oleksii Korniienko <[email protected]>

* JBIDE-27821: renamed class

Signed-off-by: Oleksii Korniienko <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants